<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{ error.code }} - {{ error.name }}</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            background-color: #f8f9fa;
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #333;
        }
        
        .error-container {
            text-align: center;
            padding: 2rem;
            max-width: 800px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
        }
        
        .error-header {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 20px;
            margin-bottom: 2rem;
            padding-bottom: 2rem;
            border-bottom: 1px solid #eee;
        }
        
        .error-code {
            font-size: 72px;
            font-weight: bold;
            color: #e74c3c;
            line-height: 1;
        }
        
        .error-divider {
            height: 100px;
            width: 1px;
            background-color: #eee;
        }
        
        .error-type {
            font-size: 32px;
            color: #2c3e50;
            max-width: 300px;
            text-align: left;
        }
        
        .error-details {
            margin-bottom: 2rem;
            padding: 1rem;
            background-color: #f8f9fa;
            border-radius: 6px;
        }
        
        .error-message {
            color: #666;
            margin-bottom: 1.5rem;
            line-height: 1.6;
        }
        
        .error-description {
            color: #888;
            font-size: 0.9rem;
            margin-bottom: 2rem;
        }
        
        .error-actions {
            display: flex;
            gap: 1rem;
            justify-content: center;
            margin-top: 2rem;
        }
        
        .button {
            display: inline-block;
            padding: 12px 24px;
            border-radius: 6px;
            text-decoration: none;
            font-weight: 500;
            transition: all 0.3s ease;
        }
        
        .button-primary {
            background-color: #3498db;
            color: white;
        }
        
        .button-primary:hover {
            background-color: #2980b9;
        }
        
        .button-secondary {
            background-color: #95a5a6;
            color: white;
        }
        
        .button-secondary:hover {
            background-color: #7f8c8d;
        }
        
        .error-footer {
            margin-top: 2rem;
            padding-top: 1rem;
            border-top: 1px solid #eee;
            font-size: 0.9rem;
            color: #95a5a6;
        }
        
        .error-code-label {
            font-size: 0.8rem;
            color: #95a5a6;
            margin-top: 0.5rem;
        }

        .status-indicator {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-right: 8px;
        }

        .status-4xx {
            background-color: #f39c12;
        }

        .status-5xx {
            background-color: #e74c3c;
        }

        .status-other {
            background-color: #95a5a6;
        }

        @media (max-width: 768px) {
            .error-header {
                flex-direction: column;
                gap: 10px;
            }
            
            .error-divider {
                height: 1px;
                width: 100px;
            }
            
            .error-type {
                text-align: center;
                font-size: 24px;
            }
            
            .error-code {
                font-size: 48px;
            }
            
            .error-actions {
                flex-direction: column;
            }
            
            .error-container {
                margin: 1rem;
            }
        }
    </style>
</head>
<body>
    <div class="error-container">
        <div class="error-header">
            <div>
                <div class="error-code">{{ error.code }}</div>
                <div class="error-code-label">错误代码</div>
            </div>
            <div class="error-divider"></div>
            <div class="error-type">
                <span class="status-indicator 
                    {%- if error.code // 100 == 4 -%}
                        status-4xx
                    {%- elif error.code // 100 == 5 -%}
                        status-5xx
                    {%- else -%}
                        status-other
                    {%- endif -%}">
                </span>
                {{ error.name }}
            </div>
        </div>
        
        <div class="error-details">
            <div class="error-message">
                {{ error.description }}
            </div>
            
            <div class="error-description">
                {% if error.code // 100 == 4 %}
                    这是一个客户端错误，可能是由于请求无效或资源不存在导致的。
                {% elif error.code // 100 == 5 %}
                    这是一个服务器错误，我们的技术团队已经收到通知并正在处理。
                {% else %}
                    发生了意外的错误情况，请稍后再试。
                {% endif %}
            </div>
        </div>
        
        <div class="error-actions">
            <a href="/" class="button button-primary">返回首页</a>
            {% if error.code // 100 == 5 %}
                <a href="javascript:window.location.reload();" class="button button-secondary">重试</a>
            {% else %}
                <a href="javascript:history.back();" class="button button-secondary">返回上一页</a>
            {% endif %}
        </div>
        
        <div class="error-footer">
            <p>如果问题持续存在，请联系技术支持</p>
        </div>
    </div>
</body>
</html>